package cn.com.cifi.mars.web.action.sync;


import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = {"IDM同步接口"})
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/idm/sync")
public interface IIdmSyncController {

	@ApiOperation(value = "增量同步idm用户信息", notes = "增量同步idm用户信息")
	@PostMapping(value = "syncUser")
	public R syncUser(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "时间戳,年月日时分秒Z(yyyymmddhhmmssZ)", required = true) @RequestParam(name = "time", defaultValue = "20191211000000Z") String time,
			@ApiParam(value = "所有*,单个例如:wangyzb", required = true) @RequestParam(name = "alias", defaultValue = "*") String alias);

	@ApiOperation(value = "增量同步岗位", notes = "增量同步岗位")
	@PostMapping(value = "syncPosition")
	public R syncPosition(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "时间戳,年月日时分秒Z(yyyymmddhhmmssZ)", required = true) @RequestParam(name = "time", defaultValue = "20191211000000Z") String time,
			@ApiParam(value = "岗位编码", required = true) @RequestParam(name = "jobNum", defaultValue = "*") String jobNum);
	
	@ApiOperation(value = "增量同步岗位组", notes = "增量同步岗位组")
	@PostMapping(value = "syncPositionGroup")
	public R syncPositionGroup(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "时间戳,年月日时分秒Z(yyyymmddhhmmssZ)", required = true) @RequestParam(name = "time", defaultValue = "20191211000000Z") String time,
			@ApiParam(value = "岗位组编码", required = true) @RequestParam(name = "jobGroupNum", defaultValue = "*") String jobGroupNum);
	
	@ApiOperation(value = "增量拉取组织机构", notes = "增量拉取组织机构 时间戳格式：20081016160000Z")
	@PostMapping(value = "incrementSyncIdmOrg")
	public R incrementSyncIdmOrg(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "增量时间戳(年月日时分秒Z(yyyymmddhhmmssZ))", required = false) @RequestParam(name = "timestamp",required = false) String timestamp,
			@ApiParam(value = "组织机构ID", required = true, defaultValue = "*") @RequestParam(name = "orgdepid",required = true) String orgdepid);
	
	@ApiOperation(value = "初始化项目取数表", notes = "初始化项目取数表")
	@PostMapping(value = "initProjectFetchNumber")
	public R initProjectFetchNumber(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = false) @RequestParam(name = "projectId",required = false) String projectId);
	
	@ApiOperation(value = "初始化组织树", notes = "初始化组织树")
	@PostMapping(value = "initProjectTree")
	public R initProjectTree(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);
	
}
